SHARED /groupname/
SHARED /groupname/ variables are accessible to all functions in a single program that declare SHARED /groupname/ variables of the same name and /groupname/.

SHARED /groupname/ variables are allocated space at fixed memory locations for the lifetime of the program, so their values persist between calls of the functions that access them, and are common to all functions that access them.

The flexibility of /groupname/ is illustrated in the following example, where the comments describe the variable sharing between two functions:

FUNCTION One ()
  SHARED /groupOne/ a,b,c  ' a shared with Two(), b, c shared with nobody
  SHARED /groupTwo/ i,j,k  ' i shared with Two(), j, k shared with nobody
  SHARED x, y, z           ' z shared with Two(), x, y shared with nobody
  x = a * i                ' a, i shared with Two(), x shared with nobody
  y = b * j                ' b, j, y shared with nobody
  z = c * k                ' z shared with Two(), c, y shared with nobody
END FUNCTION
'
FUNCTION Two ()
  SHARED /groupOne/ a,n    ' a shared with One(), n shared with nobody
  SHARED /groupTwo/ i,o    ' i shared with One(), o shared with nobody
  SHARED c, k, z           ' z shared with One(), c, k shared with nobody
  x = a * j * n            ' x,j are AUTO, a shared with One(), n not shared
  y = b * i * o            ' y, b are AUTO, i shared with One(), o not shared
  z = c * p                ' z shared with One(), c, p shared with nobody
END FUNCTION

EXTERNAL
EXTERNAL variables are accessible to all functions in all programs in a single executable that declare EXTERNAL variables of the same name.  EXTERNAL variables are allocated space at fixed memory locations for the lifetime of the executable, so their values persist between calls of functions that access them, and are shared among all functions (in all linked programs) that access them.

A ## prefix on a variable name declares the variable as EXTERNAL, even when the variable is not declared in an EXTERNAL statement.

EXTERNAL variables and arrays may not have the same name, so a and a[] cannot both be EXTERNAL.

EXTERNAL /groupname/
EXTERNAL /groupname/ variables are accessible to all functions in a single executable that declare EXTERNAL /groupname/ variables of the same name and /groupname/.

EXTERNAL /groupname/ variables are allocated space at fixed memory locations for the lifetime of the executable, so their values persist between calls of the functions that access them, and are common to all functions (in all linked programs) that access them.

EXTERNAL variables and arrays may not have the same name, so aaa and aaa[] cannot both be EXTERNAL /x/.